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

Query time 0.00031