UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '56a/4108HjnWVWvF0wG//UjsHghh2ibvUQ4i3ZCTSf0='
WHERE
key_id = '484c529520299a5215dc183d5323b5250905d20ad2e23296ddb930254b6ac4c5'
AND (
token = '56a/4108HjnWVWvF0wG//UjsHghh2ibvUQ4i3ZCTSf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)