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