UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6xLx6TH/t33s3dhDr6g25MnxpLnsqstOoOSsFpg6D+o='
WHERE
key_id = '5062398c4c7302173d379d5010865c2e6e694ed4f09b95a685bd0e837600ed05'
AND (
token = '6xLx6TH/t33s3dhDr6g25MnxpLnsqstOoOSsFpg6D+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)