UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RpjY5gjJgngEBZoCxDE0+qI7FxKPWYdBZAwEYDhrjoU='
WHERE
key_id = 'cbf8f0fc6e1a763f4f330a6fb46c9e56d5cf82a5454f3616bea430f3a711a64f'
AND (
token = 'RpjY5gjJgngEBZoCxDE0+qI7FxKPWYdBZAwEYDhrjoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)