UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SrOV/hkNthJkxMU9rvgpjJGx6EmX5Vgxo8rX7hqekdM='
WHERE
key_id = 'e51dcdc35f702f4c80a137eda64fc1f4bed293d543aa0458d5357e77e1839e7f'
AND (
token = 'SrOV/hkNthJkxMU9rvgpjJGx6EmX5Vgxo8rX7hqekdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)