UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1CNOhqpo61sOoPESN97TFgwgC7WgAHmGM4rt/ATygkE=' 
WHERE 
  key_id = '5df0131bf87490868fdfa6dd7230c4f6f49d5e771d6bdff3d9cbf244e8a6dca9' 
  AND (
    token = '1CNOhqpo61sOoPESN97TFgwgC7WgAHmGM4rt/ATygkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032