UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '88QlYY+tLnP5RX4UQs/8Ot4o8gaArWhKoLQCQwtTn7Q='
WHERE
key_id = '6196e0682a0bb768c986001af4a6114c86f9fdbb34e6a054eb9f28e883730f4b'
AND (
token = '88QlYY+tLnP5RX4UQs/8Ot4o8gaArWhKoLQCQwtTn7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)