UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UFsl7NfquqHEiiVeP3b76kQwJ0c0HhoQVbh3sCoGM74='
WHERE
key_id = '70ec52c988430b85f2425214b7400ddd8542b763ab06fdb7c3c4a458ae0858b6'
AND (
token = 'UFsl7NfquqHEiiVeP3b76kQwJ0c0HhoQVbh3sCoGM74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)