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

Query time 0.00031