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