UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bDlgvDEoiHD/EsZVmFdCQbH35kJiXMglPWyRMlUxI4Y='
WHERE
key_id = '696b5156e81d9913d0a9b9ced6b1281119a80da080f1a062cb6c8f8075948f74'
AND (
token = 'bDlgvDEoiHD/EsZVmFdCQbH35kJiXMglPWyRMlUxI4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)