UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '211YEXPkjBIcIs2sgd47Gi7WR56Q4zIJFBJXWMg6VlY='
WHERE
key_id = 'ad8f365ab483665d22ec69468536ef4d951ae9ba5f13b05f97a8734d892bdbb8'
AND (
token = '211YEXPkjBIcIs2sgd47Gi7WR56Q4zIJFBJXWMg6VlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)