UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rpnt3oOUuLcnZq1vIPHQ1qrafLmMyVN7H2hCeAL3lD0='
WHERE
key_id = 'c11d67c1f7bd79aede0843ed7ce6566244024a024355489d775c3cd0af93d9e7'
AND (
token = 'rpnt3oOUuLcnZq1vIPHQ1qrafLmMyVN7H2hCeAL3lD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)