UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5RNGGKJn/NixEPrW/kGwa9hOXVRMaJ4OhnceiDlfDpI='
WHERE
key_id = '770c92aa92ce20cbf8b37d2babc9eeafd415d29dbf6f52eaddbc2ed5bff8b59c'
AND (
token = '5RNGGKJn/NixEPrW/kGwa9hOXVRMaJ4OhnceiDlfDpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)