UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9v0lilL4D6GqhJtxXdFCVHG9Lx2w7cBeshPuHm9RVvQ='
WHERE
key_id = 'f807db92502f646aef6733b96230403fce372d4be63b61fef620073945a982ed'
AND (
token = '9v0lilL4D6GqhJtxXdFCVHG9Lx2w7cBeshPuHm9RVvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)