UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tiEO9RtovwjNmnOKu+Rl4i5b2NOibYPk0HgLvqEvA7I='
WHERE
key_id = 'f9fa23f8579730a94193a4b53afd9fc27dd25e084031ce01751b41bbf73aafb8'
AND (
token = 'tiEO9RtovwjNmnOKu+Rl4i5b2NOibYPk0HgLvqEvA7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)