UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8CTgxD/NS4SqcrdKFj/WNIAQimT6ltA6eAaJnnkmsKE='
WHERE
key_id = '4acb08730bb02d7f25947e38468390a1ce8f03d7260331b4cfc7c24650296280'
AND (
token = '8CTgxD/NS4SqcrdKFj/WNIAQimT6ltA6eAaJnnkmsKE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)