UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SQa2iiE309e/x5GV7sdpGDJjZkzkwlQ0I2TvGhzWRsE='
WHERE
key_id = '0001204ead11ad1c1cbd7891c5349110537e999ffb9917208c551c916702d264'
AND (
token = 'SQa2iiE309e/x5GV7sdpGDJjZkzkwlQ0I2TvGhzWRsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)