UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FM2l6r2/VZK3PTkdCi4WYe+UjOCE8jiWxLkqlFa9zCc='
WHERE
key_id = 'a37e63ad70f5ecfe36afc59b0a794e175bd98abc342a0163175ffafc490f2971'
AND (
token = 'FM2l6r2/VZK3PTkdCi4WYe+UjOCE8jiWxLkqlFa9zCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)