UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sAiGkbJZ72bcIWutRJToO3N6fAAE4Z6SvJOj7r6Z5Jk='
WHERE
key_id = '44e93037ba9714935a52d85d3edfd5d0d36f9aa020b1a7ae6113581af4d63a5e'
AND (
token = 'sAiGkbJZ72bcIWutRJToO3N6fAAE4Z6SvJOj7r6Z5Jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)