UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HxkvVkJstcCIYGpq1R2HnePdHSw6obI7ZOwv59FAqdk='
WHERE
key_id = 'f8264f560cbbd7b14a2b84d283827d4dedcdd483674cfb40da86f25c6ceaab3f'
AND (
token = 'HxkvVkJstcCIYGpq1R2HnePdHSw6obI7ZOwv59FAqdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)