UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Un8aRi/rxtpLl+MwKxtYocqyrS/NJ9P2g98/lu+s+u8='
WHERE
key_id = '2b07ff8d30bcada4ee96ed10969fd5fa3214bea81338a61745eeb344a4252479'
AND (
token = 'Un8aRi/rxtpLl+MwKxtYocqyrS/NJ9P2g98/lu+s+u8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)