UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1v4llmicleXFI/cqzP06bB7cJKpPYMenMpV2um9nUjg='
WHERE
key_id = 'e6400aa64486716f6fdcd7b2a6b18e278374cf3f54d8b38a45c471b318cb9321'
AND (
token = '1v4llmicleXFI/cqzP06bB7cJKpPYMenMpV2um9nUjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)