UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q4FKYl/U6cx4iAm/lNzfXOmGYJ4tWFC62HO5ITtkDtE='
WHERE
key_id = '1b807d518a203e68e8a3988ceff99195482cb4588121ea7db2ad668f93d15f36'
AND (
token = 'q4FKYl/U6cx4iAm/lNzfXOmGYJ4tWFC62HO5ITtkDtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)