UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RYVB+OW4UGe2CKxs36QeHD7/Y7vRAqY/BAt+uKnaNDA='
WHERE
key_id = 'd662f2c2520c24449ebdd8026cadb532a2f2930367f065081391729c6edc080d'
AND (
token = 'RYVB+OW4UGe2CKxs36QeHD7/Y7vRAqY/BAt+uKnaNDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)