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