UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YalJ0tQHZdr22c12GF6D1MX59jOa02PxEpO/Cy16PqE='
WHERE
key_id = '4278b286ad0f25a1d90bf5471dd6e3cbbc2a21957fcee2d2753c9c8133effecf'
AND (
token = 'YalJ0tQHZdr22c12GF6D1MX59jOa02PxEpO/Cy16PqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)