UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DG8lEpIXOwzXWJvsspHj587coRq3X8caaFAdbRLmwJ0='
WHERE
key_id = '2dcadf3322968669b7cc3257667a488aa7274b18429e3ce40d6f28a388c5d226'
AND (
token = 'DG8lEpIXOwzXWJvsspHj587coRq3X8caaFAdbRLmwJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)