UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b69RNZmWNzw22cM1BPMHchVfZicsXNlrsUlw3AIq4oE='
WHERE
key_id = '8cc36c2af29cbcbf5c4e08d83e30dcac1bb23289d1e659aa12ce678bc2d70a0a'
AND (
token = 'b69RNZmWNzw22cM1BPMHchVfZicsXNlrsUlw3AIq4oE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)