UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LZ++cWCpKrYAxd4WFkUfgJhv8Ik9SYcQbVW9Yjymmd4='
WHERE
key_id = 'bfa128f45e0a3dd77530c266de1bb266c69d171cf23d56fbc6244323a6a25921'
AND (
token = 'LZ++cWCpKrYAxd4WFkUfgJhv8Ik9SYcQbVW9Yjymmd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)